#8、
a = int(input())
b = int(input())
c = int(input())
print(f"{a:02}:{b:02}:{c:02}")
time = 24*3600
remain_time = time -3600*a-60*b-c
print(f"距离午夜还剩余{remain_time}秒")